//
//  KLSGVoiceCell.m
//  KaoLaShiGuangFM
//
//  Created by lanou3g on 15/10/29.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//

#import "KLSGVoiceCell.h"

@implementation KLSGVoiceCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubviews];
    }
    return self;
}

- (void)addSubviews
{
    self.logoImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 60, 60)];
//    self.logoImage.backgroundColor = [UIColor redColor];
    self.logoImage.layer.cornerRadius = self.logoImage.layer.frame.size.width / 2;
    self.logoImage.layer.masksToBounds = YES;
    [self addSubview:self.logoImage];
    
    self.titleLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.logoImage.frame) + 10, 5, kScreenWidth / 2, 40)];
//    self.titleLable.backgroundColor = [UIColor greenColor];
    self.titleLable.numberOfLines = 0;
    self.titleLable.font = [UIFont systemFontOfSize:16];
    [self addSubview:self.titleLable];
    
    self.nickNameLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.logoImage.frame) + 10, CGRectGetMaxY(self.titleLable.frame) - 10, kScreenWidth / 2, 30)];
//    self.nickNameLable.backgroundColor = [UIColor yellowColor];
    self.nickNameLable.font = [UIFont systemFontOfSize:13];
    self.nickNameLable.alpha = kAlpha;
    [self addSubview:self.nickNameLable];
    
    UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.logoImage.frame) + 10, CGRectGetMaxY(self.nickNameLable.frame) - 3, 10, 10)];
    imageView1.image = [UIImage imageNamed:@"live_play_num"];
    [self addSubview:imageView1];
    
    self.playTimesLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imageView1.frame), CGRectGetMaxY(self.nickNameLable.frame) - 10, 50, 25)];
//    self.playTimesLable.backgroundColor = [UIColor greenColor];
    self.playTimesLable.font = [UIFont systemFontOfSize:12];
    self.playTimesLable.alpha = kAlpha;
    [self addSubview:self.playTimesLable];
    
    UIImageView *imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.playTimesLable.frame) + 10, CGRectGetMaxY(self.nickNameLable.frame) - 5, 15, 15)];
    imageView2.image = [UIImage imageNamed:@"menu_like_normal"];
    [self addSubview:imageView2];
    
    self.likesLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imageView2.frame), CGRectGetMaxY(self.nickNameLable.frame) -10, 50, 25)];
//    self.likesLable.backgroundColor = [UIColor greenColor];
    self.likesLable.font = [UIFont systemFontOfSize:12];
    self.likesLable.alpha = kAlpha;
    [self addSubview:self.likesLable];
    
    self.downloadButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.downloadButton.frame = CGRectMake(kScreenWidth - 35, CGRectGetMaxY(self.titleLable.frame) + 5, 25, 25);
//    [self.downloadButton setBackgroundImage:[UIImage imageNamed:@"download"] forState:(UIControlStateNormal)];
    [self addSubview:self.downloadButton];
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.logoImage.frame) + 10, 79, kScreenWidth - 80, 1)];
    lineView.backgroundColor = [UIColor lightGrayColor];
    [self.contentView addSubview:lineView];

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
